package pers.lt.hibernatebeans;

import javax.persistence.*;

/**
 * Created by gjj on 2018/1/16.
 */

@Entity(name = "RIGHTS_INFO")
public class RightsInfoEntity {
    private String id;
    private String pid;
    private String rightName;
    private String rightRemarker;
    private String rightUrl;

    @Id
    @Column(name = "ID", nullable = false, length = 255)
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "PID", nullable = true, length = 255)
    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    @Basic
    @Column(name = "RIGHT_NAME", nullable = true, length = 255)
    public String getRightName() {
        return rightName;
    }

    public void setRightName(String rightName) {
        this.rightName = rightName;
    }

    @Basic
    @Column(name = "RIGHT_REMARKER", nullable = true, length = 255)
    public String getRightRemarker() {
        return rightRemarker;
    }

    public void setRightRemarker(String rightRemarker) {
        this.rightRemarker = rightRemarker;
    }

    @Basic
    @Column(name = "RIGHT_URL", nullable = true, length = 255)
    public String getRightUrl() {
        return rightUrl;
    }

    public void setRightUrl(String rightUrl) {
        this.rightUrl = rightUrl;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        RightsInfoEntity that = (RightsInfoEntity) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (pid != null ? !pid.equals(that.pid) : that.pid != null) return false;
        if (rightName != null ? !rightName.equals(that.rightName) : that.rightName != null) return false;
        if (rightRemarker != null ? !rightRemarker.equals(that.rightRemarker) : that.rightRemarker != null)
            return false;
        if (rightUrl != null ? !rightUrl.equals(that.rightUrl) : that.rightUrl != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (pid != null ? pid.hashCode() : 0);
        result = 31 * result + (rightName != null ? rightName.hashCode() : 0);
        result = 31 * result + (rightRemarker != null ? rightRemarker.hashCode() : 0);
        result = 31 * result + (rightUrl != null ? rightUrl.hashCode() : 0);
        return result;
    }
}
